package model.Entity.SIS;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the SIS_COURSE_ACTIVITIES database table.
 * 
 */
@Embeddable
public class CourseActivityPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="COURSE_NO", insertable=false, updatable=false)
	private long courseNo;

	@Column(name="COURSE_EDITION", insertable=false, updatable=false)
	private long courseEdition;

	@Column(name="ACTIVITY_CODE", insertable=false, updatable=false)
	private long activityCode;

	public CourseActivityPK() {
	}
	public long getCourseNo() {
		return this.courseNo;
	}
	public void setCourseNo(long courseNo) {
		this.courseNo = courseNo;
	}
	public long getCourseEdition() {
		return this.courseEdition;
	}
	public void setCourseEdition(long courseEdition) {
		this.courseEdition = courseEdition;
	}
	public long getActivityCode() {
		return this.activityCode;
	}
	public void setActivityCode(long activityCode) {
		this.activityCode = activityCode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CourseActivityPK)) {
			return false;
		}
		CourseActivityPK castOther = (CourseActivityPK)other;
		return 
			(this.courseNo == castOther.courseNo)
			&& (this.courseEdition == castOther.courseEdition)
			&& (this.activityCode == castOther.activityCode);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.courseNo ^ (this.courseNo >>> 32)));
		hash = hash * prime + ((int) (this.courseEdition ^ (this.courseEdition >>> 32)));
		hash = hash * prime + ((int) (this.activityCode ^ (this.activityCode >>> 32)));
		
		return hash;
	}
}